package yxy.cherry.battle.module.affix;

import java.util.ArrayList;

/**
 * @author James
 * 专门处理字符分解的工具类
 * @date 2022/3/2 10:17
 **/
public class UtilTool {
    /**
     * 按一位一位的分解成列表，最高支持5位
     * @param number
     * @return
     */
    public static ArrayList<Integer> Integer2List(int number){
        ArrayList<Integer> arrs = new ArrayList<>();
        int n1 = (number/10000)%10;
        int n2 = (number/1000)%10;
        int n3 = (number/100)%10;
        int n4 = (number/10)%10;
        int n5 = number%10;
        if(n1!=0){arrs.add(n1);}
        if(n2!=0){arrs.add(n2);}
        if(n3!=0){arrs.add(n3);}
        if(n4!=0){arrs.add(n4);}
        if(n5!=0){arrs.add(n5);}
        return arrs;
    }
}
